Make region equality emits Eq constraints#155258
Make region equality emits Eq constraints#155258ShoyuVanilla wants to merge 1 commit intorust-lang:mainfrom
Conversation
|
r? lcnr |
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
| //~| ERROR mismatched `self` parameter type | ||
| //~| NOTE expected struct `Foo<'a, 'b>` | ||
| //~| NOTE found struct `Foo<'b, 'a>` | ||
| //~| NOTE lifetime mismatch |
There was a problem hiding this comment.
Other tests are untouched but this has been affected somehow (I guess this might be due to having some duplication with both 'a: 'b, 'b: 'a and 'a == 'b)
I think this might be okay as it's unchanged anyway modulo diagnostics deduplication
There was a problem hiding this comment.
This somehow got returned back again while destructuring eq bounds 😂
This comment has been minimized.
This comment has been minimized.
49b0929 to
8d8e4f3
Compare
This comment has been minimized.
This comment has been minimized.
8d8e4f3 to
4119383
Compare
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Make region equality emits Eq constraints
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (52727e5): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary -0.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.4%, secondary -5.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 489.33s -> 490.845s (0.31%) |
|
Oh, looks like having less number of constraints by collapsing into Eq helps the perf a bit |
There was a problem hiding this comment.
I would keep assumptions as bidirectional outlives and never have Eq in there
can you make sure we always exhaustively match on ConstraintKind 🤔 I do dislike constraint kind as a concept and feel like we should just match on the actual region instead of separately storing that in the ConstraintKind
| /// - We want to uplift bidirectional constraints to the caller instead of unifying them | ||
| /// when solving nested goals, otherwise we often lose implied bounds. | ||
| /// - But we still want to know they are equal from the caller. This is crucial when we | ||
| /// are proving other nested goals which are sensitive to region equalities. |
There was a problem hiding this comment.
this comment is slightly confusing/unhelpful to me right now. It is hard to express why exactly we need this, because really, it is a hack required by the better solution not being possible
"otherwise we often lose implied bounds", what do you mean, what is often, link to a relevant example
I think the framing here isn't quite right. For me the issue is that having existential regions which aren't actually existential is not something which we can support.
Also, "know they are equal" seems slightly odd to me. Know they are equal means "unify existential regions with regions they are equal to, to resolve them to the same thing" here I think? Maybe make that more clear
I also think our conversation on zulip has been useful here, so maybe just link to that 😁
Okay, I'll keep them as they are.
Yeah, I also thought |
This comment has been minimized.
This comment has been minimized.
Make region equality emits Eq constraints
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (d50a4bb): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary 1.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 6.8%, secondary -3.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.0%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 489.936s -> 490.267s (0.07%) |
ee76953 to
91fe2b7
Compare
| self.add_constraint( | ||
| Constraint { kind: ConstraintKind::VarEqVar, sub: a, sup: b }, | ||
| origin, | ||
| ); |
There was a problem hiding this comment.
mind adding a fixme that we could only emit this constraints if unify_var_var returns an error?
91fe2b7 to
69d9237
Compare
|
@bors delegate+ r=me once CI is green |
|
✌️ @ShoyuVanilla, you can now approve this pull request! If @lcnr told you to " |
|
@bors r=lcnr |
This comment has been minimized.
This comment has been minimized.
Make region equality emits Eq constraints For context, see.. - The box named *coroutine witness Send lifetime requirements now considered by leakcheck* from [this roadmap](https://raw.githubusercontent.com/hexcatnl/roadmap/6f23e638f65249ef02af86a5454275103a71552d/next-solver.svg) - [#t-types/trait-system-refactor > A question on #251 @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/A.20question.20on.20.23251/near/584166935) - Comments on `rustc_type_ir::predicate::RegionEqPredicate`
|
💔 Test for 6492f3d failed: CI. Failed job:
|
|
A job failed! Check out the build log: (web) (plain enhanced) (plain) Click to see the possible cause of the failure (guessed by this bot) |
|
@bors retry |
|
⌛ Testing commit 69d9237 with merge 2d1b637... Workflow: https://github.com/rust-lang/rust/actions/runs/24494452747 |
Make region equality emits Eq constraints For context, see.. - The box named *coroutine witness Send lifetime requirements now considered by leakcheck* from [this roadmap](https://raw.githubusercontent.com/hexcatnl/roadmap/6f23e638f65249ef02af86a5454275103a71552d/next-solver.svg) - [#t-types/trait-system-refactor > A question on #251 @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/A.20question.20on.20.23251/near/584166935) - Comments on `rustc_type_ir::predicate::RegionEqPredicate`
View all comments
For context, see..
rustc_type_ir::predicate::RegionEqPredicate